package day06;

public class MethodDemo {
    public static void main(String[] args) {
        /*
        say();
        System.out.println("111");

        sayHi("wkj");

         */
        //sayHello("zhanying",8);
        /*
        double a = getnum();//getnum的值就是return后的那个数
        System.out.println(a);

        int m=(int)(Math.random()*100);
        int n=(int)(Math.random()*100);
        int sum = plus(m,n);
        System.out.println(m+"+"+n+"="+sum);

         */
        /*
        int[] c = testArray(8);
        System.out.println("第一个数为："+ c[0]);

        int[] d = testArray(6);
        System.out.println("数组的长度为："+ d.length);

        for (int i=0;i< c.length;i++){
            System.out.println(c[i]);
        }

         */
        aMethod();
        System.out.println(444);
    }

    /*public static void say() {
        System.out.println("1123");
    }



    public static void sayHi(String name){
            System.out.println("大家好，我叫"+name+",今年30岁了");


        }

    public static void sayHello(String name,int age){
        if(age > 60){
            return;
        }
        System.out.println("大家好，我叫"+name+",今年"+age+"岁了");
        }


        public static double getnum(){
        //在有返回值的方法中，必须通过return来返回数据
        //return; 编译错误 必须跟一个数值
        //return "abc"; 编译错误 必须和方法中的类型相匹配
        return 8.8;

    }

    public static int plus( int num1,int num2){
        int num = num1+num2;
        return num;
    }

     */
    /*
    public static int[] testArray(int len){
        int[] arr = new int[len];
        for (int i=0;i< arr.length;i++){
            arr[i] =(int) (Math.random()*100);
        }

        return arr;
    }

     */

    public static void aMethod(){
        System.out.println(111);
        bMethod();
        System.out.println(333);
    }

    public static void bMethod(){
        System.out.println(222);

    }
}
